const db = wx.cloud.database();
Page({
  data: {
    message:[],
    picture:[],
  },

  onLoad: function(options) {
    const id = options._id; 
    this.getNewsDetail(id);
  },

  getNewsDetail:function(id){
    db.collection('wccp').doc(id).get().then(res => {
      const images = res.data.images; 
      const formattedImages = images.map(image => ({ images: image })); 
      this.setData({
        message: res.data,
        picture: formattedImages 
      });
    });
  }
  
});
